package com.tallysystem.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tallysystem.dao.TallysDao;
import com.tallysystem.daoimpl.TallysDaoImpl;
import com.tallysystem.entity.Tallys;

@WebServlet("/deleteTallyServlet")
public class DeleteTallyServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int tid = Integer.parseInt(request.getParameter("tid"));
		//查询用户
		TallysDao tallyDao = new TallysDaoImpl();
		Tallys tallyOneText = tallyDao.findBytid(tid);
		ArrayList<Tallys> tallyOneList = new ArrayList<Tallys>();
		tallyOneList.add(tallyOneText);
		request.setAttribute("tallyOneList", tallyOneList);
		request.getRequestDispatcher("deleteTally.jsp").forward(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
